<?php
include_once 'conn.php';
if($_POST['last']){
    $isTop = 0;
}
else{
    $isTop = 1;
}
$sql = "update maintopic set istop = '$isTop' where id = ".$_POST['id'];
$result = mysqli_query($conn,$sql);
if($result){
    $a['error'] = 0;
}
else{
    $a['error'] = 1;
    $a['errMsg'] = '设置失败！';
}
echo json_encode($a);